#ifndef ANIMSOURCE_H
#define ANIMSOURCE_H

#include <QMutex>
#include <QtQmlIntegration>

class QVector3D;
class AnimSourcePrivate;
class AnimTrack;
class BasePose;
class AnimSource:public QObject
{
    Q_OBJECT
    QML_ELEMENT
    Q_PROPERTY(QUrl source READ getSource WRITE setSource NOTIFY sourceChanged FINAL)
public:
    AnimSource();
    ~AnimSource();

    QUrl getSource() const;
    void setSource(QUrl newSource);

    int count() const;
signals:
    void sourceChanged();

    void countChanged();

private:
    void update();
    void setCount(int newCount);
private:
    QUrl source;//动画数据源
    int m_count = 0;//素材里动画个数
    AnimSourcePrivate *_P;
    Q_PROPERTY(int count READ count NOTIFY countChanged FINAL)
    friend class AnimTrack;
    friend class BasePose;
};

#endif
